package com.matrix.draft.helloworld.spi;

import com.matrix.draft.helloworld.spi.service.Robot;

import java.util.ServiceLoader;

public class JavaSPITest {
    public static void main(String[] args){
        ServiceLoader<Robot> robots = ServiceLoader.load(Robot.class);
        robots.forEach(robot -> System.out.println(robot.sayHello("张三")));
    }
}
